﻿using System;
using System.Collections.Generic;
using System.ComponentModel;
using System.Data;
using System.Drawing;
using System.Linq;
using System.Text;
using System.Windows.Forms;

namespace BaccaratRally.Client
{
    public partial class FormResult : Form
    {
        public List<string> UrlList;
        public int index;

        public FormResult(List<string> urllist)
        {
            InitializeComponent();

            UrlList = urllist;
            index = 0;

            BindIndex();
        }

        private void btnNext_Click(object sender, EventArgs e)
        {
            if (index == UrlList.Count - 1)
            {
                index = 0;
            }
            else
            {
                index++;
            }
            BindIndex();
            this.webBrowser1.Navigate(UrlList[index]);
        }

        

        private void btnPre_Click(object sender, EventArgs e)
        {
            if (index == 0)
            {
                index = UrlList.Count - 1;
            }
            else
            {
                index--;
            }
            BindIndex();
            this.webBrowser1.Navigate(UrlList[index]);
        }

        private void BindIndex()
        {
            this.lbIndex.Text = (index + 1).ToString() + "/" + UrlList.Count.ToString();
        }


    }
}
